import 'amfe-flexible';
import '@/styles/index.less'
import '@/styles/reset.less'
import './assets/iconfont/iconfont.js'
import {
	Swipe,
	SwipeItem
} from 'vant';
import './assets/iconfont/iconfont.css'

import Vue from 'vue';
import Vant from 'vant';
Vue.use(Vant);

import 'vant/lib/index.css';
import App from './App';
import {
	router
} from './router';
import Tabbar from './components/tabbar.vue'
Vue.use(Tabbar);
Vue.component('Tabbar', Tabbar) 
import {
	Lazyload
} from 'vant';
Vue.use(Lazyload);
// 使用语言包
import VueI18n from 'vue-i18n';
import zh from "./assets/lang/zh.js";
import zhf from "./assets/lang/zhf.js";
import en from "./assets/lang/en.js";
import rb from "./assets/lang/rb.js";
import hg from "./assets/lang/hg.js";
import trq from "./assets/lang/trq.js";
import dg from "./assets/lang/dg.js";
import xby from "./assets/lang/xby.js";
import alb from "./assets/lang/alb.js";
import yn from "./assets/lang/yn.js";
import fg from "./assets/lang/fg.js";
import pty from "./assets/lang/pty.js";
Vue.use(VueI18n)

Vue.filter('filterphone',
	(value) => {
		if (value) {
			const start = value.slice(0, 5);
			const end = value.slice(-4);
			return `${start}****`;
		}
	},
)
Vue.filter('time',
	(value) => {
		if (value) {
			const start = value.slice(0, 10);
			return `${start}`;
		}
	},
)
const i18n = new VueI18n({
	locale: localStorage.getItem('lanagetype') || 'en', // set locale
	silentTranslationWarn: true,
	messages: {
		"zh": zh,
		"zhf":zhf,
		"en": en,
		"rb": rb,
		"hg": hg,
		"alb": alb,
		"trq": trq,
		"yn": yn,
		"fg": fg,
		"pty":pty,
		"dg":dg,
		"xby":xby
	},
})


Vue.prototype.imgBase = '/'
new Vue({
	i18n,
	router,
	el: '#app',
	render: h => h(App)
});
